FROM node:18.12.1 as builder

WORKDIR /five_cube_front_end

ADD package.json /five_cube_front_end/
RUN npm install --registry=https://registry.npm.taobao.org

ADD . /five_cube_front_end

RUN npm run build

# 选择更小体积的基础镜像
FROM nginx:alpine

# 将构建产物移至 nginx 中
COPY --from=builder five_cube_front_end/dist/ /usr/share/nginx/html/